cmake_minimum_required(VERSION 3.19)
project(CiYouPlayer LANGUAGES CXX)

find_package(Qt6 6.5 REQUIRED COMPONENTS Core Widgets)
find_package(Qt6 REQUIRED COMPONENTS Widgets)
find_package(Qt6 REQUIRED COMPONENTS Widgets)
find_package(Qt6 REQUIRED COMPONENTS Widgets)


INCLUDE_DIRECTORIES(
    ${PROJECT_SOURCE_DIR}
)

qt_standard_project_setup()

qt_add_executable(CiYouPlayer
    WIN32 MACOSX_BUNDLE
    main.cpp
    ciyouplayer.cpp
    ciyouplayer.h
    ciyouplayer.ui
    startuppage.h startuppage.cpp
    imageRes.qrc
    pageswitchbutton.h pageswitchbutton.cpp
    util.h
    homepagewidget.h homepagewidget.cpp homepagewidget.ui
    searchlineedit.h searchlineedit.cpp
    videobox.h videobox.cpp videobox.ui



)


qt_add_resources(
    CiYouPlayer
    PREFIX "/"
    FILES
    Image
    Image/homePage/
    Image/startupPage/
)

target_link_libraries(CiYouPlayer
    PRIVATE
        Qt::Core
        Qt::Widgets
)
target_link_libraries(CiYouPlayer PRIVATE Qt6::Widgets)
target_link_libraries(CiYouPlayer PRIVATE Qt6::Widgets)
target_link_libraries(CiYouPlayer PRIVATE Qt6::Widgets)

include(GNUInstallDirs)

install(TARGETS CiYouPlayer
    BUNDLE  DESTINATION .
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

qt_generate_deploy_app_script(
    TARGET CiYouPlayer
    OUTPUT_SCRIPT deploy_script
    NO_UNSUPPORTED_PLATFORM_ERROR
)
install(SCRIPT ${deploy_script})
